<?php

declare(strict_types=1);

namespace App\Model\Ai\Drawing;



use App\Model\Ai\Drawing\Link\LinkSampler;
use App\Model\Model;

/**
 * @property int $id 
 * @property string $name 
 * @property int $server_id 
 * @property string $content 
 * @property string $suggest 
 * @property int $weight 
 * @property string $status 
 * @property int $createtime 
 * @property int $updatetime 
 */
class DrawingSampler extends Model
{
    /**
     * The table associated with the model.
     */
    protected ?string $table = 'ai_drawing_sampler';

    /**
     * The attributes that are mass assignable.
     */
    protected array $fillable = [];

    /**
     * The attributes that should be cast to native types.
     */
    protected array $casts = ['id' => 'integer', 'server_id' => 'integer', 'weight' => 'integer', 'createtime' => 'integer', 'updatetime' => 'integer'];
	
	
	public function drawing_server()
	{
		return $this->hasManyThrough(
			DrawingServer::class,
			LinkSampler::class,
			'name',
			'id',
			'name',
			'server_id'
		)->with('user:id,nickname,avatar')->where('ai_drawing_server.status','=','normal')->limit(5);
	}
}
